home *** CD-ROM | disk | FTP | other *** search
/ All for Cell Phones: Sony Ericsson / Sony-Ericsson 2004.iso / Java / Pong / pong.jar / pong / Pong.class (.txt) < prev    next >
Encoding:
Java Class File  |  2002-01-24  |  1.3 KB  |  36 lines

  1. package pong;
  2.  
  3. import javax.microedition.lcdui.Alert;
  4. import javax.microedition.lcdui.Display;
  5. import javax.microedition.midlet.MIDlet;
  6. import javax.microedition.midlet.MIDletStateChangeException;
  7.  
  8. public class Pong extends MIDlet {
  9.    static final String DIRECTIONS_TEXT = "Welcome to game Pong!\nThe goal of the game is to score points as many as you can.";
  10.    private PongCourt court = new PongCourt(Display.getDisplay(this));
  11.    private Alert directions = new Alert("Help");
  12.  
  13.    public Pong() {
  14.       this.directions.setTimeout(-2);
  15.       this.directions.setString("Welcome to game Pong!\nThe goal of the game is to score points as many as you can.");
  16.       ExitHookup.hookup(this, this.court);
  17.    }
  18.  
  19.    public void destroyApp(boolean var1) throws MIDletStateChangeException {
  20.       this.court.destroy();
  21.    }
  22.  
  23.    void help() {
  24.       Display.getDisplay(this).setCurrent(this.directions);
  25.    }
  26.  
  27.    public void pauseApp() {
  28.       this.court.pause();
  29.    }
  30.  
  31.    public void startApp() throws MIDletStateChangeException {
  32.       Display.getDisplay(this).setCurrent(this.court);
  33.       this.court.start();
  34.    }
  35. }
  36.